package kksoft.kkexpress.executor;

import kksoft.kkexpress.funcs.IfFunc;
import kksoft.kkexpress.funcs.SwitchFunc;

import java.util.HashMap;
import java.util.Map;

public class ExpressContext {

    protected Map<String, Object> funcMap = new HashMap<String, Object>();
    protected Map<String, Object> varMap = new HashMap<String, Object>();

    public ExpressContext() {
        varMap.put("true", true);
        varMap.put("false", false);
        varMap.put("null", null);
        funcMap.put("if", new IfFunc());
        funcMap.put("switch", new SwitchFunc());
    }

    public void registerFunc(String name, Object func) {
        funcMap.put(name, func);
    }

    public void registerVar(String name, Object val) {
        varMap.put(name, val);
    }

}
